package com.shop.cereshop.commons.tencent.moderation.enums;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
 * @description: 视频审核任务类型枚举
 * @author zdd
 * @date 2025/10/31 11:27
 * @version 1.0
 */
public enum VideoTaskTypeEnum {

    // 审核类型(1-动态视频 2-商品视频 3-直播视频)
    POSTS_VIDEO(1, "宠圈动态视频"),
    LIVE_VIDEO(3, "直播视频"),
    PRODUCT_VIDEO(2, "商品视频"),

    ;

    private final Integer code;
    private final String msg;

    private static final Map<Integer, VideoTaskTypeEnum> CODE_MAP = new HashMap<>();

    static {
        for (VideoTaskTypeEnum status : VideoTaskTypeEnum.values()) {
            CODE_MAP.put(status.getCode(), status);
        }
    }

    VideoTaskTypeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }

    public static String getMsgByCode(Integer code) {
        if (Objects.isNull(code)) {
            return "";
        }
        VideoTaskTypeEnum status = CODE_MAP.get(code);
        return status != null ? status.getMsg() : "";
    }
}
